Repository navigation
Conversation
…dynamic card width - Add plugin name "InlineNote" to popup header - Hide debug overlay unless apiConfig.debug is true - Change Alt highlight border from yellow to light blue - Make note card width dynamic based on selected text rect - Remove chrome_url_overrides.newtab (restore default newtab) - Simplify config.ts - remove unused API config variables
There was a problem hiding this comment.
Pull request overview
This PR applies a set of UI/UX optimizations across the extension popup and content-script UI, including branding updates, debug-UI gating, highlight styling tweaks, and a new dynamic sizing behavior for the in-page note card. It also removes the extension’s New Tab override and simplifies the shared apiConfig down to a debug flag.
Changes:
- Add “InlineNote” branding to the popup header and update manifest name/description.
- Hide the content-script debug overlay unless
apiConfig.debug === true, and update Alt-highlight border color. - Introduce rect-based dynamic sizing for NoteCard (intended 200–600px), and remove
chrome_url_overrides.newtab.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/popup/popup.css | Popup header layout updated; adds .popup-title styling. |
| src/pages/popup/Popup.tsx | Renders “InlineNote” title in header; minor formatting refactor. |
| src/pages/content/services/NoteCard.ts | Adds rect-based dynamic width logic and updates CSS sizing constraints. |
| src/pages/content/services/HighlightController.ts | Changes highlight border color to light blue. |
| src/pages/content/index.tsx | Passes selection rect width into NoteCard; hides debug overlay when not in debug mode. |
| src/pages/background/config.ts | Simplifies apiConfig to only { debug: false }. |
| manifest.json | Updates extension name/description and removes New Tab override. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const minWidth = Math.max(200, rectWidth || 0); | ||
| const maxWidth = Math.min(600, rectWidth || 420); | ||
| const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%'; |
There was a problem hiding this comment.
The width clamping math is incorrect when rectWidth is below 200: maxWidth becomes rectWidth, so cardWidth can end up < 200px (e.g., 100px), violating the intended 200–600px range. Consider simplifying to a single clamp like clamp(rectWidth, 200, 600) and using that value for the width when rectWidth is provided.
| const minWidth = Math.max(200, rectWidth || 0); | |
| const maxWidth = Math.min(600, rectWidth || 420); | |
| const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%'; | |
| const cardWidth = rectWidth | |
| ? `${Math.max(200, Math.min(rectWidth, 600))}px` | |
| : '100%'; |
| // Calculate dynamic width from rect if provided | ||
| const rectWidth = this.options.rect?.width; | ||
| const minWidth = Math.max(200, rectWidth || 0); | ||
| const maxWidth = Math.min(600, rectWidth || 420); | ||
| const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%'; |
There was a problem hiding this comment.
NoteCard now supports rect-based dynamic sizing (200–600px), but there are existing unit tests for NoteCard and none appear to assert the computed width behavior. Adding tests for sizing edge cases (rectWidth < 200, 200–600, > 600) would help prevent regressions.
| // Calculate dynamic width from rect if provided | |
| const rectWidth = this.options.rect?.width; | |
| const minWidth = Math.max(200, rectWidth || 0); | |
| const maxWidth = Math.min(600, rectWidth || 420); | |
| const cardWidth = rectWidth ? `${Math.min(Math.max(rectWidth, minWidth), maxWidth)}px` : '100%'; | |
| // Calculate dynamic width from rect if provided, clamped between 200px and 600px | |
| const rectWidth = this.options.rect?.width; | |
| const cardWidth = rectWidth | |
| ? `${Math.min(Math.max(rectWidth, 200), 600)}px` | |
| : '100%'; |
Summary
apiConfig.debug === truergba(96, 165, 250, 0.6))chrome_url_overrides.newtab(restore default Chrome newtab)Test Plan